﻿#ifndef CExportResultTh_H
#define CExportResultTh_H
/********************************************************************************
** @ Date:2025/09/05
** @ Author: HanJiaXin
** @ Description:导出Ai报告线程类
** @ Version:1.0.0
** @ ClassName:CExportResultTh
** @ Fun:
********************************************************************************/
#include <QThread>
#include <QMutex>
#include <QDateTime>
#include "CPdfRptInterface.h"

class CExportResultTh : public QThread
{
	Q_OBJECT

public:
	CExportResultTh();
	~CExportResultTh();

	void ThreadStart();
	void ThreadStop();

protected:
	void run() override;

private:
	bool m_bShouldStop;			             //线程是否销毁
	bool m_bFrist;                           //是否是首次开启线程，防止重启启动设备的时候频繁创建线程
	bool m_bFindLastResultTime;				 //是否查询过上次报告生成时间
	std::atomic<bool>      m_bhread;         //线程运行状态
	int m_nCount;
	QMutex   *m_pMutex;
	QDateTime m_dLastResultTime;			//上次生成报告时间
	CPdfRptInterface* m_pPdfRptInterface;	//导出报表接口
};

#endif